package cc.denglu.sdk;



/**
 * @author cc@denglu.cc songjw@denglu.cc
 * @version 1.0
 * @created 09-八月-2011 14:59:39
 * 
 * 错误类型对照表
 * Code Description
 * 1 	参数错误，请参考API文档
 * 2 	站点不存在
 * 3 	时间戳有误
 * 4 	只支持md5签名
 * 5 	签名不正确
 * 6 	token已过期
 * 7 	媒体用户不存在
 * 8 	媒体用户已绑定其他用户
 * 9 	媒体用户已解绑
 * 10 	未知错误
 */
public class DengluException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7817545506814364145L;
	private int errorCode;
	private String errorDescription;

	public DengluException(String message) {
		super(message);
		this.errorDescription = message;
	}

	public DengluException(Exception e) {
		super(e);
	}

	public DengluException(String message, int statusCode) {
		super(message);
		this.errorCode = statusCode;
	}

	public DengluException(String message, Exception e){
		super(message, e);
		this.errorDescription = message;
	}

	public DengluException(String message, Exception e, int statusCode){
		super(message, e);
		this.errorCode = statusCode;
		this.errorDescription = message;
	}

	public int geterrorCode(){
		return errorCode;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void seterrorCode(int newVal){
		errorCode = newVal;
	}

	public String geterrorDescription(){
		return errorDescription;
	}

	/**
	 * 
	 * @param newVal
	 */
	public void seterrorDescription(String newVal){
		errorDescription = newVal;
	}
}